package com.keli.dt.model.bpss;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.BatchPreparedStatementSetter;

import com.keli.dt.model.RoadReport;

public class RoadReportDeleteBPSS implements BatchPreparedStatementSetter {
	public static final String DELETE_SQL = "DELETE FROM DT_ROAD_REPORT_R WHERE DETECT_CLASS = ? AND ROAD_ID = ?";
	
	private List<RoadReport> roadReports;
	
	public RoadReportDeleteBPSS(List<RoadReport> roadReports) {
		this.roadReports = roadReports;
	}

	@Override
	public void setValues(PreparedStatement ps, int i) throws SQLException {
		RoadReport rr = roadReports.get(i);
		ps.setString(1, rr.getDETECT_CLASS());
		ps.setString(2, rr.getROAD_ID().toString());
	}

	@Override
	public int getBatchSize() {
		return roadReports.size();
	}

}
